﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using DocumentManagement.ViewsModels;
using DocumentManagement.Models;
using System.Data;

namespace DocumentManagement.Views
{
    /// <summary>
    /// Interaction logic for OptionDocument.xaml
    /// </summary>
    public partial class OptionDocument : Window
    {
        OptionDocumentViewsModel _optionDocumentViewsModel;
        public OptionDocument(CreateSend createSend, QSHCEntities1 entity)
        {
            InitializeComponent();
            _optionDocumentViewsModel = this.Resources["optionDocumentViewsModel"] as OptionDocumentViewsModel;
            _optionDocumentViewsModel.MyCreateSend = createSend;
            _optionDocumentViewsModel.EntityModels = entity;
        }

    
      

        private void OKButton_Click(object sender, RoutedEventArgs e)
        {
            if (ShowDocumentOUTRadioButton.IsChecked == true)
            {
                
         
                CreateDocumentOUT CreateDoc = new CreateDocumentOUT(_optionDocumentViewsModel.MyCreateSend, _optionDocumentViewsModel.EntityModels);

                CreateDoc.CreateSendCodeTextBox.Focus();
                CreateDoc.ShowDialog();
                this.Close();
      
                return;
            }
            else if (ShowDocumentINRadioButton.IsChecked == true)
            {

                CreateDocumentINN CreateDoc = new CreateDocumentINN(_optionDocumentViewsModel.MyCreateSend, _optionDocumentViewsModel.EntityModels);
                CreateDoc.NameInstitutionTextBox.Focus();
                CreateDoc.ShowDialog();
                this.Close();
            
                return;
            }
           

            
        }

      
        
    }
}
